if (command === 'play') {
const voiceChannel = message.member?.voice?.channel; //加入發文者在的語音伺服器
if (voiceChannel) { //判斷是否在語音頻道
distube.play(voiceChannel, args.join(' '), {
message,
textChannel: message.channel,
member: message.member,
});
//在所在的voiceChannel,搜尋args裡的歌曲
} else {
message.channel.send(
'你需要先加入語音頻道',
);
}
}
if (command === 'stop') {
distube.stop(message);
message.channel.send('停止音樂');
}
if (command === 'leave') {
distube.voices.get(message)?.leave();
message.channel.send('離開語音');
}
if (command === 'resume') distube.resume(message);
if (command === 'pause') distube.pause(message);
if (command === 'skip') distube.skip(message);